/*
//------------------------假接口API和方法
//统一管理项目好友相关接口
import request from '@/utils/request'
import type { sendMessage, getAllMessageResponseData, sendMessageResponseData } from './type'

enum API {
    //获取所有消息接口
    GETALLMESSAGE_URL = '/friend/get',
    //发送消息接口
    SENDMESSAGE_URL = '/friend/send',
}

//获取所有消息接口方法
export const reqGetAllMessage = () =>
    request.get<any, getAllMessageResponseData>(API.GETALLMESSAGE_URL)
//发送消息接口方法
export const reqSendMessage = (data: sendMessage) =>
    request.post<any, sendMessageResponseData>(API.SENDMESSAGE_URL, data)
*/

//统一管理项目用户相关接口
import request from '@/utils/request'
import type {
    chatHistoryResponseData,
    messageFormData,
    userInfoResponseData,
    userFriendsResponseData,
    chatListFriendsResponseData,
    updateUnReadFormData,
    FriendRequireResponseData,
    VerifyFormData,
    SearchUserFormData,
    SearchUserResponseData,
    SetChatStatusFormData,
    ApplyFormData,
} from './type'
import { responseData } from '../user/type'

//请求接口API
enum API {
    //获取聊天记录
    CHATHISTORY_URL = '/info/chathistory',
    //发送消息接口
    SENDMESSAGE_URL = '/info/sendmessage',
    //获取用户信息
    USERINFO_URL = '/info/userinfo',
    //获取用户聊天好友信息
    CHATLISTFRIENDS_URL = '/info/chatlistfriends',
    //获取用户好友信息
    USERFRIENDS_URL = '/info/userfriends',
    //处理更新未读消息数量
    UPDATEUNREAD_URL = '/info/unread',
    //获取好友申请信息
    FRIENDREQUIRE_URL = '/info/friendrequire',
    //验证好友申请
    VERIFYREQUIRE_URL = '/info/verifyrequire',
    //查找好友
    SEARCHUSER_URL = '/info/searchuser',
    //申请好友
    APPLYFRIEND_URL = 'info/apply',
    //更改好友聊天页状态(是否可见)
    SETCHATSTATUS_URL = '/info/setchat',
}

//获取用户聊天记录的接口方法
export const reqChatHistory = () => request.get<any, chatHistoryResponseData>(API.CHATHISTORY_URL)
//发送消息的接口方法
export const reqSendMessage = (data: messageFormData) =>
    request.post<any, responseData>(API.SENDMESSAGE_URL, data)
//获取用户信息接口方法
export const reqUserInfo = () => request.get<any, userInfoResponseData>(API.USERINFO_URL)
//获取用户聊天好友信息接口方法
export const reqChatListFriends = () =>
    request.get<any, chatListFriendsResponseData>(API.CHATLISTFRIENDS_URL)
//获取用户好友的接口方法
export const reqUserFriends = () => request.get<any, userFriendsResponseData>(API.USERFRIENDS_URL)
//处理更新未读消息数量接口方法
export const reqUpdateUnRead = (data: updateUnReadFormData) =>
    request.post<any, responseData>(API.UPDATEUNREAD_URL, data)
//获取好友申请信息
export const reqGetFriendRequire = () =>
    request.get<any, FriendRequireResponseData>(API.FRIENDREQUIRE_URL)
//验证好友申请
export const reqVerifyRequire = (data: VerifyFormData) =>
    request.post<any, responseData>(API.VERIFYREQUIRE_URL, data)
//查找好友
export const reqSearchUser = (data: SearchUserFormData) =>
    request.post<any, SearchUserResponseData>(API.SEARCHUSER_URL, data)
//申请好友
export const reqApplyFriend = (data: ApplyFormData) =>
    request.post<any, responseData>(API.APPLYFRIEND_URL, data)
//更改好友聊天页状态(是否可见)
export const reqSetChatStatus = (data: SetChatStatusFormData) =>
    request.post<any, responseData>(API.SETCHATSTATUS_URL, data)
